package com.cmz.common.dto;

import com.cmz.common.api.dto.StandardRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * 通用请求
 * @param <T> 请求数据类型
 * @author cmz
 */
@Getter
@Setter
@ApiModel("通用请求")
public class Request<T> implements StandardRequest<T> {

    /** 请求数据 */
    @ApiModelProperty(name = "data", value = "请求数据")
    @Valid @NotNull(message = "validation.data.null") private T data;

    /** 请求元数据 */
    @ApiModelProperty(name = "meta", value = "请求元数据")
    private Meta meta = new Meta();

}
